package com.houseman.workFlow.dao;

import java.util.List;

import com.houseman.workFlow.bean.WorkFlowBean;
import com.houseman.workFlow.bean.WorkFlowGraph;
import com.houseman.workFlow.dto.NextStepInfo;

public interface GraphDao {

	/**
	 * 查询流程图信息
	 * @return
	 * @throws Exception
	 */
	public WorkFlowGraph queryGraphById(int graphId) throws Exception;
	
	/**
	 * 查询流程图信息
	 * @return
	 * @throws Exception
	 */
	public List<WorkFlowGraph> queryGraphsByFolder() throws Exception;
	
	/**
	 * 保存流程图信息
	 * @param graph
	 * @throws Exception
	 */
	public int savaGraph(WorkFlowGraph graph) throws Exception;
	
	/**
	 * 更新流程图信息
	 * @param graph
	 * @throws Exception
	 */
	public void updateGraph(WorkFlowGraph graph) throws Exception;
	
	/**
	 * 删除流程图
	 * @param graphId
	 * @throws Exception
	 */
	public void deleteGraph(int graphId) throws Exception;
	
	/**
	 * 根据用户角色查询其可以发起的流程列表
	 * @param role
	 * @return
	 * @throws Exception
	 */
	public List<WorkFlowGraph> queryStartWFByRole(String role) throws Exception;
	
	/**
	 * 查询流程下一代办的信息
	 * @param graphId
	 * @param step
	 * @return
	 * @throws Exception
	 */
	public List<NextStepInfo> getNextStepInfo(int graphId, int step) throws Exception;
	
	/**
	 * 根据graphId查询graph信息
	 * @param graphId
	 * @return
	 * @throws Exception
	 */
	public WorkFlowBean queryNewBuildGraph(int graphId) throws Exception;
}
